﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace GotLyrics.Dialogs
{
    public partial class SelectScopeNameDialog : BaseDialog
    {
        public SelectScopeNameDialog(Dictionary<string, bool> fields, GotLyricsMainForm mainForm) : base(mainForm)
        {
            InitializeComponent();

            foreach (string field in fields.Keys)
            {
                if (!fields[field])
                {
                    comboBoxTagName.Items.Add(field);
                }
            }

            if (comboBoxTagName.Items.Count > 0)
                comboBoxTagName.SelectedIndex = 0;
        }

        /// <summary>
        /// Gets the selected field.
        /// </summary>
        /// <value>The selected field.</value>
        public string SelectedField
        {
            get { return (string)comboBoxTagName.SelectedItem; }
        }

        private void btOk_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }

        private void btCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            Close();
        }
    }
}
